﻿using Song.Common.Tools;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace Test.Unit
{
    
    
    /// <summary>
    ///This is a test class for DictionaryExtensionsTest and is intended
    ///to contain all DictionaryExtensionsTest Unit Tests
    ///</summary>
    [TestClass()]
    public class DictionaryExtensionsTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for AddOrReplace
        ///</summary>
        public void AddOrReplaceTestHelper<TKey, TValue>()
        {
            Dictionary<TKey, TValue> dict = null; // TODO: Initialize to an appropriate value
            TKey key = default(TKey); // TODO: Initialize to an appropriate value
            TValue value = default(TValue); // TODO: Initialize to an appropriate value
            Dictionary<TKey, TValue> expected = null; // TODO: Initialize to an appropriate value
            Dictionary<TKey, TValue> actual;
            actual = DictionaryExtensions.AddOrReplace<TKey, TValue>(dict, key, value);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void AddOrReplaceTest()
        {
            AddOrReplaceTestHelper<GenericParameterHelper, GenericParameterHelper>();
        }

        /// <summary>
        ///A test for AddRange
        ///</summary>
        public void AddRangeTestHelper<TKey, TValue>()
        {
            Dictionary<TKey, TValue> dict = null; // TODO: Initialize to an appropriate value
            IEnumerable<KeyValuePair<TKey, TValue>> values = null; // TODO: Initialize to an appropriate value
            bool replaceExisted = false; // TODO: Initialize to an appropriate value
            Dictionary<TKey, TValue> expected = null; // TODO: Initialize to an appropriate value
            Dictionary<TKey, TValue> actual;
            actual = DictionaryExtensions.AddRange<TKey, TValue>(dict, values, replaceExisted);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void AddRangeTest()
        {
            AddRangeTestHelper<GenericParameterHelper, GenericParameterHelper>();
        }

        /// <summary>
        ///A test for GetValue
        ///</summary>
        public void GetValueTestHelper<TKey, TValue>()
        {
            Dictionary<TKey, TValue> dict = null; // TODO: Initialize to an appropriate value
            TKey key = default(TKey); // TODO: Initialize to an appropriate value
            TValue defaultValue = default(TValue); // TODO: Initialize to an appropriate value
            TValue expected = default(TValue); // TODO: Initialize to an appropriate value
            TValue actual;
            actual = DictionaryExtensions.GetValue<TKey, TValue>(dict, key, defaultValue);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void GetValueTest()
        {
            GetValueTestHelper<GenericParameterHelper, GenericParameterHelper>();
        }

        /// <summary>
        ///A test for TryAdd
        ///</summary>
        public void TryAddTestHelper<TKey, TValue>()
        {
            Dictionary<TKey, TValue> dict = null; // TODO: Initialize to an appropriate value
            TKey key = default(TKey); // TODO: Initialize to an appropriate value
            TValue value = default(TValue); // TODO: Initialize to an appropriate value
            Dictionary<TKey, TValue> expected = null; // TODO: Initialize to an appropriate value
            Dictionary<TKey, TValue> actual;
            actual = DictionaryExtensions.TryAdd<TKey, TValue>(dict, key, value);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void TryAddTest()
        {
            TryAddTestHelper<GenericParameterHelper, GenericParameterHelper>();
        }
    }
}
